.class public Lcom/netease/newsreader/activity/BaseTabActivity;
.super Landroid/app/TabActivity;
.source "BaseTabActivity.java"

# interfaces
.implements Lcom/netease/newsreader/util/ThemeSettingsHelper$ThemeCallback;


# instance fields
.field public app:Lcom/netease/newsreader/activity/MyApplication;

.field public db:Landroid/database/sqlite/SQLiteDatabase;

.field private mPaused:Z

.field private mThemeChanged:Z

.field private mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

.field public screenheight:I

.field public screentype:I

.field public screenwidth:I

.field private sp:Landroid/content/SharedPreferences;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 24
    invoke-direct {p0}, Landroid/app/TabActivity;-><init>()V

    .line 25
    const/4 v0, 0x3

    iput v0, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->screentype:I

    .line 29
    const/16 v0, 0x1e0

    iput v0, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->screenwidth:I

    .line 30
    const/16 v0, 0x320

    iput v0, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->screenheight:I

    .line 83
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mPaused:Z

    .line 24
    return-void
.end method


# virtual methods
.method public applyTheme()V
    .locals 1

    .prologue
    .line 87
    iget-boolean v0, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mPaused:Z

    if-eqz v0, :cond_0

    .line 88
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mThemeChanged:Z

    .line 92
    :goto_0
    return-void

    .line 90
    :cond_0
    invoke-virtual {p0}, Lcom/netease/newsreader/activity/BaseTabActivity;->onApplyTheme()V

    goto :goto_0
.end method

.method public getThemeSettingsHelper()Lcom/netease/newsreader/util/ThemeSettingsHelper;
    .locals 1

    .prologue
    .line 95
    iget-object v0, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    return-object v0
.end method

.method public onApplyTheme()V
    .locals 0

    .prologue
    .line 102
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 4
    .parameter "savedInstanceState"

    .prologue
    .line 35
    invoke-super {p0, p1}, Landroid/app/TabActivity;->onCreate(Landroid/os/Bundle;)V

    .line 36
    invoke-static {p0}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->getThemeSettingsHelper(Landroid/content/Context;)Lcom/netease/newsreader/util/ThemeSettingsHelper;

    move-result-object v2

    iput-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    .line 37
    iget-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    invoke-virtual {v2, p0}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->registerThemeCallback(Lcom/netease/newsreader/util/ThemeSettingsHelper$ThemeCallback;)V

    .line 39
    invoke-static {p0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v2

    iput-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->sp:Landroid/content/SharedPreferences;

    .line 40
    invoke-virtual {p0}, Lcom/netease/newsreader/activity/BaseTabActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    check-cast v2, Lcom/netease/newsreader/activity/MyApplication;

    iput-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->app:Lcom/netease/newsreader/activity/MyApplication;

    .line 42
    iget-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->app:Lcom/netease/newsreader/activity/MyApplication;

    invoke-virtual {v2}, Lcom/netease/newsreader/activity/MyApplication;->getSQLiteDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2

    iput-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->db:Landroid/database/sqlite/SQLiteDatabase;

    .line 43
    iget-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->db:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v2, :cond_0

    iget-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->isOpen()Z

    move-result v2

    if-nez v2, :cond_1

    .line 44
    :cond_0
    new-instance v0, Lcom/netease/newsreader/db/NewsSQLiteOpenHelper;

    invoke-virtual {p0}, Lcom/netease/newsreader/activity/BaseTabActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v0, v2}, Lcom/netease/newsreader/db/NewsSQLiteOpenHelper;-><init>(Landroid/content/Context;)V

    .line 45
    .local v0, sqlOpenHelper:Lcom/netease/newsreader/db/NewsSQLiteOpenHelper;
    invoke-virtual {v0}, Lcom/netease/newsreader/db/NewsSQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2

    iput-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->db:Landroid/database/sqlite/SQLiteDatabase;

    .line 46
    iget-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->app:Lcom/netease/newsreader/activity/MyApplication;

    iget-object v3, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->db:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2, v3}, Lcom/netease/newsreader/activity/MyApplication;->setDb(Landroid/database/sqlite/SQLiteDatabase;)V

    .line 47
    iget-object v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->app:Lcom/netease/newsreader/activity/MyApplication;

    invoke-virtual {v2, v0}, Lcom/netease/newsreader/activity/MyApplication;->setSqlOpenHelper(Lcom/netease/newsreader/db/NewsSQLiteOpenHelper;)V

    .line 49
    .end local v0           #sqlOpenHelper:Lcom/netease/newsreader/db/NewsSQLiteOpenHelper;
    :cond_1
    invoke-static {p0}, Lcom/netease/newsreader/util/Tools;->getScreenMetrics(Landroid/content/Context;)I

    move-result v2

    iput v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->screentype:I

    .line 50
    invoke-static {p0}, Lcom/netease/newsreader/util/Tools;->getWidth_Height(Landroid/content/Context;)Ljava/util/HashMap;

    move-result-object v1

    .line 51
    .local v1, whmap:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Integer;>;"
    const-string v2, "w"

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/Integer;

    invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I

    move-result v2

    iput v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->screenwidth:I

    .line 52
    const-string v2, "h"

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/Integer;

    invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I

    move-result v2

    iput v2, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->screenheight:I

    .line 53
    return-void
.end method

.method protected onDestroy()V
    .locals 1

    .prologue
    .line 67
    invoke-super {p0}, Landroid/app/TabActivity;->onDestroy()V

    .line 68
    iget-object v0, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    invoke-virtual {v0, p0}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->unRegisterThemeCallback(Lcom/netease/newsreader/util/ThemeSettingsHelper$ThemeCallback;)V

    .line 69
    return-void
.end method

.method protected onResume()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 73
    invoke-super {p0}, Landroid/app/TabActivity;->onResume()V

    .line 74
    iput-boolean v1, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mPaused:Z

    .line 76
    iget-boolean v0, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mThemeChanged:Z

    if-eqz v0, :cond_0

    .line 77
    iput-boolean v1, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mThemeChanged:Z

    .line 78
    invoke-virtual {p0}, Lcom/netease/newsreader/activity/BaseTabActivity;->onApplyTheme()V

    .line 80
    :cond_0
    return-void
.end method

.method protected onStop()V
    .locals 1

    .prologue
    .line 59
    invoke-super {p0}, Landroid/app/TabActivity;->onStop()V

    .line 60
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/netease/newsreader/activity/BaseTabActivity;->mPaused:Z

    .line 61
    return-void
.end method
